package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.Coach;
import com.ruoyi.business.mapper.CoachMapper;
import com.ruoyi.business.service.ICoachService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CoachServiceImpl extends ServiceImpl<CoachMapper, Coach> implements ICoachService {
    @Resource
    private CoachMapper coachMapper;

    /**
     * 查询教练列表
     * @return 教练集合
     */
    public List<Coach> getAllCoachList() {
        return coachMapper.selectAllCoachList();
    }
    @Override
    public List<Coach> getCoachList(Coach coach) {
        return coachMapper.selectCoachList(coach);
    }


    @Override
    public int insertCoach(Coach coach) {
        return coachMapper.insertCoach(coach);
    }

    @Override
    public int updateCoach(Coach coach) {
        return coachMapper.updateCoach(coach);
    }

    @Override
    public Coach getCoachById(long id) {
        return coachMapper.selectById(id);
    }

}
